import 'package:cloudapp/esdk/response/user_login_response.dart';
import 'package:flutter/material.dart';

class LoginUserInfo with ChangeNotifier {
  var _user = UserLoginResponse();
  UserLoginResponse get user => _user;
  String get loginName {
    // 如果有用户名，优先返回用户名
    if(_user.userName.isNotEmpty) {
      return _user.userName;
    }

    return "";
  }

  void login(UserLoginResponse info) {
    _user = info;
  }

  void logout() {
    _user = UserLoginResponse();
  }
}
